/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package formularios.model;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Ramon
 */
@Entity
@Table(name = "EMPREGADOS")
@NamedQueries({
    @NamedQuery(name = "Empregados.findAll", query = "SELECT e FROM Empregados e"),
    @NamedQuery(name = "Empregados.findByCpf", query = "SELECT e FROM Empregados e WHERE e.cpf = :cpf"),
    @NamedQuery(name = "Empregados.findByNome", query = "SELECT e FROM Empregados e WHERE e.nome = :nome"),
    @NamedQuery(name = "Empregados.findByDtns", query = "SELECT e FROM Empregados e WHERE e.dtns = :dtns"),
    @NamedQuery(name = "Empregados.findBySexo", query = "SELECT e FROM Empregados e WHERE e.sexo = :sexo"),
    @NamedQuery(name = "Empregados.findByEndereco", query = "SELECT e FROM Empregados e WHERE e.endereco = :endereco"),
    @NamedQuery(name = "Empregados.findByEmail", query = "SELECT e FROM Empregados e WHERE e.email = :email"),
    @NamedQuery(name = "Empregados.findByTelefone", query = "SELECT e FROM Empregados e WHERE e.telefone = :telefone"),
    @NamedQuery(name = "Empregados.findByCargo", query = "SELECT e FROM Empregados e WHERE e.cargo = :cargo"),
    @NamedQuery(name = "Empregados.findBySalario", query = "SELECT e FROM Empregados e WHERE e.salario = :salario"),
    @NamedQuery(name = "Empregados.findByHiredate", query = "SELECT e FROM Empregados e WHERE e.hiredate = :hiredate")})
public class Empregados implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "CPF")
    private String cpf;
    @Basic(optional = false)
    @Column(name = "NOME")
    private String nome;
    @Column(name = "DTNS")
    @Temporal(TemporalType.DATE)
    private Date dtns;
    @Column(name = "SEXO")
    private Character sexo;
    @Column(name = "ENDERECO")
    private String endereco;
    @Column(name = "EMAIL")
    private String email;
    @Column(name = "TELEFONE")
    private String telefone;
    @Basic(optional = false)
    @Column(name = "CARGO")
    private String cargo;
    @Basic(optional = false)
    @Column(name = "SALARIO")
    private double salario;
    @Basic(optional = false)
    @Column(name = "HIREDATE")
    @Temporal(TemporalType.DATE)
    private Date hiredate;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "empregados")
    private Collection<Vendas> vendasCollection;

    public Empregados() {
    }

    public Empregados(String cpf) {
        this.cpf = cpf;
    }

    public Empregados(String cpf, String nome, Date dtns, char sexo, String endereco,
                      String email, String cargo, Double salario, Date hiredate, String telefone) {
        this.cpf = cpf;
        this.nome = nome;
        this.dtns = dtns;
        this.sexo = sexo;
        this.endereco = endereco;
        this.email = email;
        this.cargo = cargo;
        this.salario = salario;
        this.hiredate = hiredate;
        this.telefone = telefone;
    }

    public String getCpf() {
        return cpf;
    }

    public void setCpf(String cpf) {
        this.cpf = cpf;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public Date getDtns() {
        return dtns;
    }

    public void setDtns(Date dtns) {
        this.dtns = dtns;
    }

    public Character getSexo() {
        return sexo;
    }

    public void setSexo(Character sexo) {
        this.sexo = sexo;
    }

    public String getEndereco() {
        return endereco;
    }

    public void setEndereco(String endereco) {
        this.endereco = endereco;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getTelefone() {
        return telefone;
    }

    public void setTelefone(String telefone) {
        this.telefone = telefone;
    }

    public String getCargo() {
        return cargo;
    }

    public void setCargo(String cargo) {
        this.cargo = cargo;
    }

    public double getSalario() {
        return salario;
    }

    public void setSalario(double salario) {
        this.salario = salario;
    }

    public Date getHiredate() {
        return hiredate;
    }

    public void setHiredate(Date hiredate) {
        this.hiredate = hiredate;
    }

    public Collection<Vendas> getVendasCollection() {
        return vendasCollection;
    }

    public void setVendasCollection(Collection<Vendas> vendasCollection) {
        this.vendasCollection = vendasCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cpf != null ? cpf.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Empregados)) {
            return false;
        }
        Empregados other = (Empregados) object;
        if ((this.cpf == null && other.cpf != null) || (this.cpf != null && !this.cpf.equals(other.cpf))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "formularios.model.Empregados[cpf=" + cpf + "]";
    }

}
